<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
	<link rel="shortcut icon" type="image/png" href="/favicon.png">

	
	<link rel="stylesheet" href="/css/style.css">
	<link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
	<script src="/js/main.js"></script>
	

	<!-- Begin Jekyll SEO tag v2.1.0 -->
<title>Using jussi as a Multiplexer - Steem Developer</title>
<meta property="og:title" content="Using jussi as a Multiplexer" />
<meta name="description" content="Optimize your local applications with jussi" />
<meta property="og:description" content="Optimize your local applications with jussi" />
<link rel="canonical" href="https://developer.steem.io/tutorials-recipes/jussi-multiplexer" />
<meta property="og:url" content="https://developer.steem.io/tutorials-recipes/jussi-multiplexer" />
<meta property="og:site_name" content="Steem Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-07-20T12:56:08-05:00" />
<script type="application/ld+json">
{"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "Using jussi as a Multiplexer",
"datePublished": "2018-07-20T12:56:08-05:00",
"description": "Optimize your local applications with jussi",
"url": "https://developer.steem.io/tutorials-recipes/jussi-multiplexer"}</script>
<!-- End Jekyll SEO tag -->


	
</head>
<body>
<header>
	<h1>
		<button type="button" class="open-nav" id="open-nav"></button>
		<a href="/"  class="logo-link"><img src="/images/logotype_white.svg" height="40" alt="Steem Developer logo"></a>
	</h1>

	
	<form action="/search/" method="get">
		<input type="text" name="q" id="search-input" placeholder="Search">
		<input type="submit" value="Search" style="display: none;">
	</form>
	

	<div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Steem</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-steemd-nodes">steemd Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Steem Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-steemit">Steemit.com</a></li>
						
					
						
						<li><a href="/services/#services-steemconnect">SteemConnect</a></li>
						
					
						
						<li><a href="/services/#services-jussi">jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-sbds">SBDS</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-comment">Broadcast Ops Comment</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/community/">
		<h6 class="ctrl-nav-section title">Community</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/community/#community-overview">Overview</a></li>
						
					
						
						<li><a href="/community/#community-resources">Resources</a></li>
						
					
						
						<li><a href="/community/#community-developeradvocate">Sharing & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>


	<!--<p class="copyright">-->
	<!--<a href="https://steemit.com.com/">-->
	<!--steemit-->
	<!--</a>-->
	<!--</p>-->
	<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
	<div class="hero">
		<h1 class="hero__h1">Steem Developer Portal </h1>
		
		<img class="hero__img" src="/images/hero.png">
		
	</div>
	<section id="tutorials-recipes-jussi-multiplexer" class="row tutorials-recipes-jussi-multiplexer">
	<h3>
		<a id="tutorials-recipes-jussi-multiplexer">
			Using jussi as a Multiplexer
			
		</a>
	</h3>
	
		<p class="description">Optimize your local applications with jussi</p>
	

	<p><em>By the end of this recipe you should know how to install <code class="highlighter-rouge">jussi</code> on your local subnet to take advantage of its features.</em></p>

<p>This recipe will take you through the process of setting up <code class="highlighter-rouge">jussi</code> for a small infrastructure like a home network.</p>

<h2 id="intro">Intro</h2>

<p>What is a Multiplexer?  In this context, a multiplexer an appliance that accepts API requests from multiple applications running on the same subnet and passes them to an upstream node.  This means, for example, if you have two applications that request the same block from API, your local <code class="highlighter-rouge">jussi</code> instance will make a single upstream request for the block and return it to both applications.</p>

<p>Deploying <code class="highlighter-rouge">jussi</code> on your own local subnet will help improve efficiency because your local applications won’t require SSL and <code class="highlighter-rouge">jussi</code> can take care of gzipping requests that go out over the Internet.</p>

<center>
  <img src="/images/tutorials-recipes/jussi-multiplexer/network-diagram.png" alt="Network Diagram" />
</center>

<h2 id="steps">Steps</h2>

<ol>
  <li><a href="#setting-up-docker"><strong>Setting Up Docker</strong></a> In order to run <code class="highlighter-rouge">jussi</code>, <code class="highlighter-rouge">docker</code> is recommended</li>
  <li><a href="#install-jussi"><strong>Install <code class="highlighter-rouge">jussi</code></strong></a> Clone <code class="highlighter-rouge">jussi</code> from the repository and build</li>
  <li><a href="#configure-your-apps"><strong>Configure Your Apps</strong></a> Point all of your applications to this node</li>
</ol>

<h4 id="1-setting-up-docker-">1. Setting Up Docker <a name="setting-up-docker"></a></h4>

<p>Although it’s possible to set up <code class="highlighter-rouge">jussi</code> to run natively without virtualization, <code class="highlighter-rouge">docker</code> is recommended.  Setting up <code class="highlighter-rouge">docker</code> depends on your operating system:</p>

<ul>
  <li><a href="https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce">Docker for Linux</a></li>
  <li><a href="https://docs.docker.com/docker-for-mac/install/">Docker for macOS</a></li>
  <li><a href="https://docs.docker.com/docker-for-windows/">Docker for Windows</a></li>
</ul>

<h4 id="2-install-jussi-">2. Install <code class="highlighter-rouge">jussi</code> <a name="install-jussi"></a></h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>git clone https://github.com/steemit/jussi.git
<span class="nb">cd </span>jussi
</code></pre>
</div>

<p>Edit the file <code class="highlighter-rouge">DEV_config.json</code> and change all:</p>

<p><code class="highlighter-rouge">https://steemd.steemitdev.com</code></p>

<p>… to …</p>

<p><code class="highlighter-rouge">https://api.steemit.com</code></p>

<p>Then build and run:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>docker build -t<span class="o">=</span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">/jussi:</span><span class="k">$(</span>git rev-parse --abbrev-ref HEAD<span class="k">)</span><span class="s2">"</span> .
docker run -itp 9000:8080 <span class="s2">"</span><span class="nv">$USER</span><span class="s2">/jussi:</span><span class="k">$(</span>git rev-parse --abbrev-ref HEAD<span class="k">)</span><span class="s2">"</span>
</code></pre>
</div>

<h4 id="3-configure-your-apps-">3. Configure Your Apps <a name="configure-your-apps"></a></h4>

<p>Now, you can use your new <code class="highlighter-rouge">jussi</code> node as if it’s a full node running locally.  For example:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>curl -s --data <span class="s1">'{"jsonrpc":"2.0", "method":"condenser_api.get_block", "params":[8675309], "id":1}'</span> http://localhost:9000
</code></pre>
</div>

<p>In this case, <code class="highlighter-rouge">http://localhost:9000</code> will act like a full node.  In reality, it’s passing all of its request to its upstream, <code class="highlighter-rouge">https://api.steemit.com</code>.</p>

<p>Once you’ve implemented your own <code class="highlighter-rouge">jussi</code> node in this manner, you should notice an improvement in bandwidth utilization.  If you’re internet provider implements packet shaping strategies, this will have a positive impact because you are no longer streaming the entire blockchain once for each application.</p>

<h2 id="troubleshooting--updating">Troubleshooting / Updating</h2>

<h4 id="error-invalid-argument-jussimaster-for-tjussimaster-invalid-reference-format">Error: <code class="highlighter-rouge">invalid argument "/jussi:master" for t=/jussi:master: invalid reference format</code></h4>

<p><em>Solution:</em></p>

<p>You’re probably trying to run on a raspberry pi.  Just replace <code class="highlighter-rouge">$USER</code> in the command with the current user.</p>

<hr />

<p>If you would like to update <code class="highlighter-rouge">jussi</code> to the latest version, here’s a quick way:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>git stash <span class="o">&amp;&amp;</span> git pull <span class="o">&amp;&amp;</span> git stash pop
</code></pre>
</div>

<p>If there are <code class="highlighter-rouge">git</code> errors due to structural changes to <code class="highlighter-rouge">DEV_config.json</code>, just start over from step 2 and reclone <code class="highlighter-rouge">jussi</code> to a fresh location.  Otherwise, you should be able to rebuild and run.</p>

</section>

</div>
<div class="footer">
	<a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

